<?php 
include("includes/code_admin.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />
<title><?php echo SITEURL; ?> Administrator</title>
<link href="style_admin.css" rel="stylesheet" type="text/css" />

</head>

<body>
<div id="container">
<table class="main" cellspacing="0" cellpadding="0">
  <tr>
    <td class="header">
    <!-- header start -->
    <?php include("includes/header.php");?>
    <!-- header finish -->
    </td>
  </tr>
  <tr>
    <td class="middle">&nbsp;</td>
  </tr>
  <tr>
    <td>
    <!-- tepa start -->
<?php include("includes/tepa.php"); ?>
    <!-- tepa finish -->
    </td>
  </tr>
  <tr>
    <td>
    <!-- contant start -->
<table class="content" cellspacing="0" cellpadding="0">
  <tr valign="top">
    <td>

<!-- right col -->
<div class="right_col">
<h3 class="title">Sayt matnlari</h4>

<?php 
if(isset($_POST['send']))
{
	$id_array = $_POST['id'];
	$trans_array = $_POST['trans'];
	
	$son = count($trans_array);
	
	for($i=0; $i < $son; $i++) {
	$trans_array[$i] = addslashes($trans_array[$i]);
	$natija = mysql_query("UPDATE lang SET uzb='$trans_array[$i]' WHERE id='$id_array[$i]'");
	echo "<p>".stripslashes($trans_array[$i])."</p>";
	}
	
	if($natija=='true')
	{ echo "<p class='ok'>Malumotlar o'zgardi</p> <br><center><a href='index.php'><b>Bosh sahifaga</b></a></center><br>"; }
	else 
	{ echo "<p class='error'>XATOLIK, Afsuski malumotlar qo'shilmadi, admin bilan maslahatlashing</p>"; }
}

if(!isset($_POST['send']))
{
$result = mysql_query("SELECT id,name,uzb FROM lang");
if (!$result)
{ echo "<p class='error'>Bazadagi lang jadvalidan malumotlar olinmadi, bu haqida adminga ayting...</p>"; }

$myrow = mysql_fetch_array($result);
?>
<fieldset>
<legend style="color:#456F98">Saytdagi Matn va Yozuvlarni boshqarish</legend>
<form name="myform" action="" method="post">
<table width="750" border="0" cellspacing="7" cellpadding="2">
<?php 
do
{
?>
<tr> 
<td> <input name="id[]" type="hidden" size="2" maxlength="5" value="<? echo $myrow['id']; ?>"/> <? echo $myrow['name']; ?> </td>
<td> <input name="trans[]" type="text" size="80" maxlength="150" value="<? echo stripslashes($myrow['uzb']); ?>"/> </td>
</tr>
<?
}
while($myrow = mysql_fetch_array($result));

?>
  <tr>
    <td>&nbsp;</td>
    <td><input type="submit" name="send" value=" Saqlash " /> </td>
  </tr>
</table>
</form>

<?php 
}
?>
</fieldset>
</div>
	<!-- right col finish -->
    </td>
  </tr>
</table>


    <!-- contant finish -->
    </td>
  </tr>
</table>
<!-- futer start -->
<?php include("includes/futer.php"); ?>
<!-- futer finish -->
</div>
</body>
</html>
